import { axios } from '@/utils/request';

const api = {
    // 项目定义
    defineAll: '/external/item/all',
    definePage: '/external/item/page',
    defineCreate: '/external/item/create',
    defineUpdate: '/external/item/update',
    defineDelete: '/external/item/delete',
    // 项目等级
    levelAll: '/external/level/all',
    levelPage: '/external/level/page',
    levelCreate: '/external/level/create',
    levelUpdate: '/external/level/update',
    levelDelete: '/external/level/delete',
    // 考评方案
    planPage: '/external/plan/page',
    planCreate: '/external/plan/create',
    planUpdate: '/external/plan/update',
    planUpdateParam: '/external/plan/updateParam',
    planDelete: '/external/plan/delete',

    deptPlanAll: '/external/dept/plan/page',
    deptPlanCreate: '/external/dept/plan/create',
    deptPlanUpdate: '/external/dept/plan/update',
    deptPlanDelete: '/external/dept/plan/delete',
    typeAll: '/external/type/all',
    typeCreate: '/external/type/create',
    typeDelete: '/external/type/delete',
    typeUpdate: '/external/type/update',
    getDeptPlan: '/external/plan/getDeptPlan',
    getUserPlan: '/external/plan/getUserPlan',
    getNoteAll: '/external/app/note/all',
}
export function getNoteAll(params) {
    return axios({
        url: api.getNoteAll,
        method: 'get',
        params
    });
}

export function typeDelete(id, data) {
    return axios({
        url: `${api.typeDelete}/${id}`,
        method: 'delete',
        data
    });
}

export function getDeptPlan(params) {
    return axios({
        url: api.getDeptPlan,
        method: 'get',
        params
    });
}

export function getUserPlan(params) {
    return axios({
        url: api.getUserPlan,
        method: 'get',
        params
    });
}


export function typeCreate(data) {
    return axios({
        url: api.typeCreate,
        method: 'post',
        data
    });
}

export function typeUpdate(data) {
    return axios({
        url: api.typeUpdate,
        method: 'put',
        data
    });
}

export function typeAll(params) {
    return axios({
        url: api.typeAll,
        method: 'get',
        params
    });
}

export function deptPlanDelete(id, data = {}) {
    return axios({
        url: `${api.deptPlanDelete}/${id}`,
        method: 'delete',
        data
    });
}

export function deptPlanCreate(data) {
    return axios({
        url: api.deptPlanCreate,
        method: 'post',
        data
    });
}

export function deptPlanUpdate(data) {
    return axios({
        url: api.deptPlanUpdate,
        method: 'put',
        data
    });
}

// deptPlanAll
export function deptPlanAll(params) {
    return axios({
        url: api.deptPlanAll,
        method: 'get',
        params
    });
}

// 考评方案
export function planPage(params) {
    return axios({
        url: api.planPage,
        method: 'get',
        params
    });
}

export function planCreate(data) {
    return axios({
        url: api.planCreate,
        method: 'post',
        data
    });
}

export function planUpdate(data) {
    return axios({
        url: api.planUpdate,
        method: 'put',
        data
    });
}

export function planUpdateParam(data) {
    return axios({
        url: api.planUpdateParam,
        method: 'put',
        data
    });
}

export function planDelete(id, data) {
    return axios({
        url: `${api.planDelete}/${id}`,
        method: 'delete',
        data
    });
}

// 考评等级
export function levelAll(params) {
    return axios({
        url: api.levelAll,
        method: 'get',
        params
    });
}

export function levelPage(params) {
    return axios({
        url: api.levelPage,
        method: 'get',
        params
    });
}

export function levelCreate(data) {
    return axios({
        url: api.levelCreate,
        method: 'post',
        data
    });
}

export function levelUpdate(data) {
    return axios({
        url: api.levelUpdate,
        method: 'put',
        data
    });
}

export function levelDelete(id, params) {
    return axios({
        url: `${api.levelDelete}/${id}`,
        method: 'delete',
        params
    });
}

// 项目定义
export function defineAll(params) {
    return axios({
        url: api.defineAll,
        method: 'get',
        params
    });
}

export function definePage(params) {
    return axios({
        url: api.definePage,
        method: 'get',
        params
    });
}

export function defineCreate(data) {
    return axios({
        url: api.defineCreate,
        method: 'post',
        data
    });
}

export function defineUpdate(data) {
    return axios({
        url: api.defineUpdate,
        method: 'put',
        data
    });
}

export function defineDelete(id, params) {
    return axios({
        url: `${api.defineDelete}/${id}`,
        method: 'delete',
        params
    });
}

